import { UUID } from "@/utils/util";
import {type BaseResponse} from '@/webApis/base';

export namespace order{
	/**
	 * 获取订单分页
	 */
	export const getPageListAsync = async (data:{pageNum:number, pageSize:number,menuName:string}): Promise<BaseResponse> => {
		return new Promise((resolve) => {
		    setTimeout(() => {
		        let response:BaseResponse = {
		            rows: [],
					total: 35,
		        }
		        for (let i = 0; i < data.pageSize; i++) {
		            response.rows.push({
		                id: UUID(),
		                orderStatus: i % 4 + 1,
		                name: `${data.menuName}-${data.pageNum}-${i}`,
		                price: Number((Math.random() * 20000 + 100).toFixed(0)),//分
		                count: Number((Math.random() * 5 + 1).toFixed(0)),//正整数
		            });
		        }
		        resolve(response)
		    }, 200);
		})
	}
}

